<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateKmsDailyTaskNodes extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kms_task_nodes', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("taskId")->comment("kms_task.id")->default(0);
            $table->unsignedTinyInteger("step")->comment("流程步骤")->default(0);
            $table->unsignedTinyInteger("businessType")->default(0)->comment("节点业务分类");
            $table->text("businessTypeText")->default("")->comment("节点业务分类 - 文本");
            $table->unsignedTinyInteger("businessStatus")->default(0)->comment("节点业务状态");
            $table->string("businessStatusText")->default("")->comment("节点业务状态 - 文本");
            $table->unsignedTinyInteger("isApprovalRejected")->default(0)->comment("是否被驳回的审批 0 - 否 1 - 是");
            $table->unsignedBigInteger("handleType")->default(0)->comment("节点处理类型 0 - 有一人处理即可");
            $table->unsignedTinyInteger("approveType")->default(0)->comment("审批节点类型 0 - 驳回直接终止流程 1 - 回到上一节点");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '日常任务节点表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kms_task_nodes');
    }
}
